﻿



//商品类别
window.operateEvents = {
    'click .txcg': function (e, value, row, index) {
        MyDialog.confirm("你确定要进行此项操作？", function () {
            $.post("../SpeList/DLLAjaxHandler.ashx", { Action: "TX_STATUS", id: row.ID, status: "提现成功", remark: "" },
                function (data) {
                    if (data == "success") {
                        $("#FTGrid").bootstrapTable('updateRow', {
                            index: index,
                            row: {
                                Status: "提现成功"
                            }
                        });
                        toastr.success("操作成功");

                    } else {
                        toastr.error("操作失败");
                    }
                }
            )
        })
    }
};
var option = {};
option.columns = [
             {
                 field: 'ID',
                 title: '序号'
             }, {
                 sortable: true,
                 field: 'UserName',
                 title: '用户名称'
             }, {
                 field: 'AlipayName',
                 title: '支付宝姓名'

             }, {
                 field: 'AlipayNo',
                 title: '支付宝帐号'

             }, {
                 field: 'Change',
                 title: '提现金额',
             }, {
                 field: 'Balance',
                 title: '余额'

             }, {
                 field: 'Status',
                 title: '状态'
             }
             , {
                 field: 'Desp',
                 title: '备注'
             }
             , {
                 field: 'CreateUser',
                 title: '操作',
                 formatter: function (value, row, index) {
                     if (row.Status=="未处理") {
                         return "<a  class='txcg' href='#'>提现成功</a><a  class='jjtx' dataid='" + row.ID + "' rowindex='" + index + "' href='#'style='color:red;mar;margin-left:20px' >拒绝</a>";

                     } else {
                         return "-";
                     }
                 },
                 events: operateEvents

             }
];

$(document).ready(function () {
    $(".addForm,.EditForm,.DelForm").remove();
    $(".jjtx").YanTip({
        title: "拒绝提现",
        place: "top",
        content: '<div class="row"><div class="col-xs-12"><div class="form-group"><label>拒绝原因</label> <input type="text" value="" class="form-control jjyy" /></div></div></div>',
        showed: function ($tip) {
        },
        confirm: function ($tip, $dom) {
            var dataid = $dom.attr("dataid");
            var rowindex = $dom.attr("rowindex");
            var jjyy = $tip.find('.jjyy').val();
            if (jjyy != "") {
                $.post("../SpeList/DLLAjaxHandler.ashx", { Action: "TX_STATUS", id: dataid, status: "拒绝提现", remark: jjyy },
                     function (data) {
                         if (data == "success") {
                             $("#FTGrid").bootstrapTable('updateRow', {
                                 index: rowindex,
                                 row: {
                                     Status: "拒绝提现"
                                 }
                             });
                             $(".Yan_tip").remove();
                             toastr.success("操作成功");

                         } else {
                             toastr.error("操作失败");
                         }
                     });
            } else {
                alert("请输入原因");
            }
        }
    });
});
